/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package stack;

import java.util.Vector;

/**
 *
 * @author USER
 */
public class Stack<E> implements Stacki<E> {

    /**
     * @param args the command line arguments
     */
protected Vector<E> data;

	public Stack()
	// post: constructs a new, empty stack
	{
		data = new Vector<E>();
	
        }


    @Override
    public void push(E item) {
       data.addElement(item); 
    }

    @Override
    public E pop() {
      return  data.remove(data.size()-1);
      
    }

    @Override
    public E peek() {
        return data.get(data.size()-1);

    }

    @Override
    public boolean empty() {
       return data.isEmpty();
    }

    @Override
    public int size() {
       return data.size();
    }
}
